import { Base } from '../../utils/base.js'

class Store extends Base {
  constructor() {
    super();
  }
  /*获得商家其下所有分类*/
  getCategory(id, callback) {
    var param = {
      url: 'store/all/' + id,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }

  /*获得商家信息及其商家旗下产品,pageIndex 从1开始*/
  getStore(id, callback) {
    var Params = {
      url: 'store/'+id,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(Params);
  }

  /*获得商家分类获得旗下产品*/
  getProductsByStoreCate(key,id, callback) {
    var param = {
      url: 'product/by_storeCate/+'+key+'/'+id,
      sCallback: function (data) {
        callback && callback(data);
      }
    };
    this.request(param);
  }
}



export { Store };